package org.helgoboss.scite

import java.io.File
import org.helgoboss.text_editor.TextEditor
import sys.process._

class Scite(val exeFile: File) extends TextEditor {
    def open(files: Seq[File] = Nil, newWindow: Boolean = false, block: Boolean = false) = {
        val cmd = new SciteCommand(exeFile = exeFile, files = files, newWindow = newWindow)

        val p = Process(cmd.components)
        if (block) {
            p!
        } else {
            p.run
            0
        }
    }
}